﻿using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
namespace CoreModule.Converters
{
    /// <summary>
    /// 页边距 大小转换
    /// </summary>
    public class UserCardMargin20Converter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            double viewportWidth = (double)value;
            double bottom = Math.Min(viewportWidth * 0.002, 10);
            return new Thickness(0, 0, 0, bottom);
           
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="value"></param>
        /// <param name="targetType"></param>
        /// <param name="parameter"></param>
        /// <param name="culture"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
